package com.alibaba.algo.dao.user;

import com.alibaba.algo.core.base.BaseMapper;
import com.alibaba.algo.entity.user.SysEmployee;
import com.alibaba.algo.entity.user.SysUserEmployee;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 类SysUserEmployeeMapper.java的实现描述：用户员工表Mapper
 *
 * @author nieganggang 2021-03-12 16:08:17
 */
public interface SysUserEmployeeMapper extends BaseMapper<SysUserEmployee> {

    /**
     * 根据用户标识查询员工详情 有效数据
     *
     * @param userId 用户标识
     * @return 员工详情
     */
    SysEmployee selectEmployeeByUserId(@Param("userId") Long userId);

    /**
     * 根据用户标识查询员工详情 全部数据
     *
     * @param userId 用户标识
     * @return 员工详情
     */
    SysEmployee selectEmployeeByUserIdDefaultAll(@Param("userId") Long userId, @Param("isDeleted") String isDeleted);

    Integer deleteByUserId(Long userId);

    Long selectUserIdByEmployeeId(@Param("employeeId") Long employeeId);

    void updateByUserId(@Param("obj") SysUserEmployee obj);

    void updateByUserIdLastModified(@Param("obj") SysUserEmployee obj, @Param("lastModifyTime") LocalDateTime lastModifyTime);

    Integer updateByIdWithIsDeleted(@Param("obj") SysUserEmployee obj);

    Integer countByEmployeeIdAndUserId(@Param("obj") SysUserEmployee obj);

    List<SysUserEmployee> listByEmployeeId(@Param("obj") SysUserEmployee obj);

    List<SysUserEmployee> listByEmployeeIdLastModified(@Param("obj") SysUserEmployee obj, @Param("lastModifyTime") LocalDateTime lastModifyTime);

    List<SysUserEmployee> listByParaLastModified(@Param("obj") SysUserEmployee obj, @Param("lastModifyTime") LocalDateTime lastModifyTime, @Param("sort") String sort);
}
